package com.xyw.code.study20200813.po;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * Created with IntelliJ IDEA.
 * User: xuyiwei
 * Date: 2020/8/26
 * Time: 下午4:50
 * Email: 1328312923@qq.com
 * Description: No Description
 **/
public class Test01 {

    public String a;

    public static void main(String[] args) throws CloneNotSupportedException {
        Student student1 = new Student("小张");
        Student student2 = new Student("小李");
        swag(student1,student2);
        System.out.println(student1.getName());
        System.out.println(student2.getName());
    }

    private static void swag(Student student1, Student student2) {
        Student temp = student1;
        student1 = student2;
        student2 = temp;
        System.out.println("x:" + student1.getName());
        System.out.println("y:" + student2.getName());

     }
}
@Data
@AllArgsConstructor
class Student{
    private String name;

}
